package com.pro.controller;

import com.aaa.entity.TProduct;
import com.aaa.util.Result;
import com.pro.service.ITProductService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 于永利
 * @since 2023-07-20
 */
@RestController
@RequestMapping("/t-product")
public class TProductController {
    /**
     * 根据id  查询商品的信息
     */
    // Result
    @Resource
    private ITProductService productService;

    @GetMapping
    @PreAuthorize("hasRole('admin123')")
    public Result getAllPro(){
        List<TProduct> list = productService.list();
        return new Result(8701,"成功",list);
    }

}
